import { configureStore } from '@reduxjs/toolkit'
import cartSlice  from './cartSlice'
// 创建仓库
import { useDispatch, useSelector } from 'react-redux'
export const store = configureStore({
  reducer: {
   cartSlice
  },
})
export type RootState = ReturnType<typeof store.getState>
export type AppDispatch = typeof store.dispatch

export const useAppDispatch = useDispatch.withTypes<AppDispatch>()
export const useAppSelector = useSelector.withTypes<RootState>()
